package com.hlkj.pay.util.excel;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.hlkj.pay.enums.PayOrderEnums;

public class MerchantSignStatusConverter implements Converter<Integer> {

    @Override
    public Class supportJavaTypeKey() {
        return Integer.class;
    }

    @Override
    public com.alibaba.excel.enums.CellDataTypeEnum supportExcelTypeKey() {
        return com.alibaba.excel.enums.CellDataTypeEnum.STRING;
    }

    @Override
    public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) {
        // 将 Java 数据写回到 Excel
        Integer value = context.getValue();
        if (value == null) {
            return new WriteCellData<>("");
        }
        //1=待补充资料，2=待审核，3=待签约，4=签约中，5=签约成功，0=审核驳回
        String val = "未定义状态";
        switch (value) {
            case 0:
                val = "审核驳回";
                break;
            case 1:
                val = "待补充资料";
                break;
            case 2:
                val = "待审核";
                break;
            case 3:
                val = "待签约";
                break;
            case 4:
                val = "签约中";
                break;
            case 5:
                val = "签约成功";
                break;
        }
        return new WriteCellData<>(val);
    }
}